/*
 * @Author: 清香白莲 1243327527@qq.com
 * @Date: 2023-09-21 11:23:42
 * @LastEditors: 清香白莲 1243327527@qq.com
 * @LastEditTime: 2023-09-21 11:37:51
 * @FilePath: /shang_study/src/utils/uuid_token.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { v4 as uuidv4 } from 'uuid';

export const getUUID = () => {
    let uuid_token = localStorage.getItem("UUIDTOKEN");
    if (!uuid_token) {
        uuid_token = uuidv4();
        localStorage.setItem("UUIDTOKEN", uuid_token);
    }
    return uuid_token;
}